<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <!-- 3.使用组件 -->
        <my-cpn></my-cpn>
        <my-cpn></my-cpn>
        <my-cpn></my-cpn>
        <my-cpn></my-cpn>
    </div>
</body>
<script src='../js/vue.js'></script>
<script>
    // 1.创建组件构造器对象
    const cpn = Vue.extend({
        template:  `
            <div>
                <h2>我是标题</h2>
                <p>哈哈哈哈</p>
            </div>
        `
    })
    //2.注册组件
    // Vue.component(使用组件的标签名, 传入创建的组件构造器) 
    Vue.component('my-cpn', cpn) 
    let app = new Vue({
        el: '#app',
        data: {
             msg:'hello vue.js'
        },
        methods: {}
    })
</script>
</html>